<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>peach.nn.base</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="peach-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a href="http://code.google.com/p/peach">Peach - Computational Intelligence for Python</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="peach-module.html">Package&nbsp;peach</a> ::
        <a href="peach.nn-module.html">Package&nbsp;nn</a> ::
        Module&nbsp;base
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="peach.nn.base-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="peach.nn.base-module.html">Module peach.nn.base</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment">################################################################################</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"># Peach - Computational Intelligence for Python</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"># Jose Alexandre Nalon</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment"># This file: nn/base.py</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-comment"># Basic definitions for layers of neurons</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-comment">################################################################################</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-comment"># Doc string, reStructuredText formatted:</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt id="link-0" class="py-name" targets="Variable peach.__doc__=peach-module.html#__doc__,Variable peach.fuzzy.__doc__=peach.fuzzy-module.html#__doc__,Variable peach.fuzzy.base.__doc__=peach.fuzzy.base-module.html#__doc__,Variable peach.fuzzy.cmeans.__doc__=peach.fuzzy.cmeans-module.html#__doc__,Variable peach.fuzzy.control.__doc__=peach.fuzzy.control-module.html#__doc__,Variable peach.fuzzy.defuzzy.__doc__=peach.fuzzy.defuzzy-module.html#__doc__,Variable peach.fuzzy.mf.__doc__=peach.fuzzy.mf-module.html#__doc__,Variable peach.fuzzy.norms.__doc__=peach.fuzzy.norms-module.html#__doc__,Variable peach.ga.__doc__=peach.ga-module.html#__doc__,Variable peach.ga.base.__doc__=peach.ga.base-module.html#__doc__,Variable peach.ga.chromosome.__doc__=peach.ga.chromosome-module.html#__doc__,Variable peach.ga.crossover.__doc__=peach.ga.crossover-module.html#__doc__,Variable peach.ga.fitness.__doc__=peach.ga.fitness-module.html#__doc__,Variable peach.ga.mutation.__doc__=peach.ga.mutation-module.html#__doc__,Variable peach.ga.selection.__doc__=peach.ga.selection-module.html#__doc__,Variable peach.nn.__doc__=peach.nn-module.html#__doc__,Variable peach.nn.af.__doc__=peach.nn.af-module.html#__doc__,Variable peach.nn.base.__doc__=peach.nn.base-module.html#__doc__,Variable peach.nn.kmeans.__doc__=peach.nn.kmeans-module.html#__doc__,Variable peach.nn.lrules.__doc__=peach.nn.lrules-module.html#__doc__,Variable peach.nn.mem.__doc__=peach.nn.mem-module.html#__doc__,Variable peach.nn.nnet.__doc__=peach.nn.nnet-module.html#__doc__,Variable peach.nn.rbfn.__doc__=peach.nn.rbfn-module.html#__doc__,Variable peach.optm.__doc__=peach.optm-module.html#__doc__,Variable peach.optm.base.__doc__=peach.optm.base-module.html#__doc__,Variable peach.optm.linear.__doc__=peach.optm.linear-module.html#__doc__,Variable peach.optm.multivar.__doc__=peach.optm.multivar-module.html#__doc__,Variable peach.optm.quasinewton.__doc__=peach.optm.quasinewton-module.html#__doc__,Variable peach.optm.stochastic.__doc__=peach.optm.stochastic-module.html#__doc__,Variable peach.pso.__doc__=peach.pso-module.html#__doc__,Variable peach.pso.acc.__doc__=peach.pso.acc-module.html#__doc__,Variable peach.pso.base.__doc__=peach.pso.base-module.html#__doc__,Variable peach.sa.__doc__=peach.sa-module.html#__doc__,Variable peach.sa.base.__doc__=peach.sa.base-module.html#__doc__,Variable peach.sa.neighbor.__doc__=peach.sa.neighbor-module.html#__doc__"><a title="peach.__doc__
peach.fuzzy.__doc__
peach.fuzzy.base.__doc__
peach.fuzzy.cmeans.__doc__
peach.fuzzy.control.__doc__
peach.fuzzy.defuzzy.__doc__
peach.fuzzy.mf.__doc__
peach.fuzzy.norms.__doc__
peach.ga.__doc__
peach.ga.base.__doc__
peach.ga.chromosome.__doc__
peach.ga.crossover.__doc__
peach.ga.fitness.__doc__
peach.ga.mutation.__doc__
peach.ga.selection.__doc__
peach.nn.__doc__
peach.nn.af.__doc__
peach.nn.base.__doc__
peach.nn.kmeans.__doc__
peach.nn.lrules.__doc__
peach.nn.mem.__doc__
peach.nn.nnet.__doc__
peach.nn.rbfn.__doc__
peach.optm.__doc__
peach.optm.base.__doc__
peach.optm.linear.__doc__
peach.optm.multivar.__doc__
peach.optm.quasinewton.__doc__
peach.optm.stochastic.__doc__
peach.pso.__doc__
peach.pso.acc.__doc__
peach.pso.base.__doc__
peach.sa.__doc__
peach.sa.base.__doc__
peach.sa.neighbor.__doc__" class="py-name" href="#" onclick="return doclink('link-0', '__doc__', 'link-0');">__doc__</a></tt> <tt class="py-op">=</tt> <tt class="py-docstring">"""</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-docstring">Basic definitions for layers of neurons.</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-docstring">This subpackage implements the basic classes used with neural networks. A neural</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-docstring">network is basically implemented as a layer of neurons. To speed things up, a</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-docstring">layer is implemented as a array, where each line represents the weight vector</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-docstring">of a neuron. Further definitions and algorithms are based on this definition.</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-comment">################################################################################</tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">numpy</tt> <tt class="py-keyword">import</tt> <tt class="py-name">dot</tt><tt class="py-op">,</tt> <tt class="py-name">array</tt><tt class="py-op">,</tt> <tt class="py-name">reshape</tt><tt class="py-op">,</tt> <tt class="py-name">vstack</tt><tt class="py-op">,</tt> <tt class="py-name">ones</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">random</tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Function peach.nn.rbfn.randn()=peach.nn.rbfn-module.html#randn"><a title="peach.nn.rbfn.randn" class="py-name" href="#" onclick="return doclink('link-1', 'randn', 'link-1');">randn</a></tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-2" class="py-name" targets="Module peach.nn.af=peach.nn.af-module.html"><a title="peach.nn.af" class="py-name" href="#" onclick="return doclink('link-2', 'af', 'link-2');">af</a></tt> <tt class="py-keyword">import</tt> <tt id="link-3" class="py-name" targets="Class peach.nn.af.Activation=peach.nn.af.Activation-class.html"><a title="peach.nn.af.Activation" class="py-name" href="#" onclick="return doclink('link-3', 'Activation', 'link-3');">Activation</a></tt><tt class="py-op">,</tt> <tt id="link-4" class="py-name" targets="Class peach.nn.af.Linear=peach.nn.af.Linear-class.html"><a title="peach.nn.af.Linear" class="py-name" href="#" onclick="return doclink('link-4', 'Linear', 'link-4');">Linear</a></tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt id="link-5" class="py-name" targets="Variable peach.nn.base._BIAS=peach.nn.base-module.html#_BIAS,Variable peach.nn.lrules._BIAS=peach.nn.lrules-module.html#_BIAS"><a title="peach.nn.base._BIAS
peach.nn.lrules._BIAS" class="py-name" href="#" onclick="return doclink('link-5', '_BIAS', 'link-5');">_BIAS</a></tt> <tt class="py-op">=</tt> <tt class="py-name">ones</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">dtype</tt><tt class="py-op">=</tt><tt class="py-name">float</tt><tt class="py-op">)</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"><tt class="py-string">"""This constant vector is defined to implement in a fast way the bias of a</tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-string">neuron, as an input of value 1, stacked over the real input to the neuron."""</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-comment">################################################################################</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-comment"># Classes</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-comment">################################################################################</tt> </tt>
<a name="Layer"></a><div id="Layer-def"><a name="L33"></a><tt class="py-lineno"> 33</tt> <a class="py-toggle" href="#" id="Layer-toggle" onclick="return toggle('Layer');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html">Layer</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Layer-expanded"><a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line">    <tt class="py-docstring">'''</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"><tt class="py-docstring">    Base class for neural networks.</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"><tt class="py-docstring">    This class implements a layer of neurons. It is represented by a array of</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line"><tt class="py-docstring">    real values. Each line of the array represents the weight vector of a</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"><tt class="py-docstring">    single neuron. If the neurons on the layer are biased, then the first</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"><tt class="py-docstring">    element of the weight vector is the bias weight, and the bias input is</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt class="py-docstring">    always valued 1. Also, to each layer is associated an activation function,</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"><tt class="py-docstring">    that determines if the neuron is fired or not. Please, consult the module</tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"><tt class="py-docstring">    ``af`` to see more about activation functions.</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line"><tt class="py-docstring">    In general, this class shoulb be subclassed if you want to use neural nets.</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line"><tt class="py-docstring">    But, as neural nets are very different one from the other, check carefully</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line"><tt class="py-docstring">    the documentation to see if the attributes, properties and methods are</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line"><tt class="py-docstring">    suited to your task.</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="Layer.__init__"></a><div id="Layer.__init__-def"><a name="L50"></a><tt class="py-lineno"> 50</tt> <a class="py-toggle" href="#" id="Layer.__init__-toggle" onclick="return toggle('Layer.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">shape</tt><tt class="py-op">,</tt> <tt class="py-param">phi</tt><tt class="py-op">=</tt><tt id="link-6" class="py-name"><a title="peach.nn.af.Linear" class="py-name" href="#" onclick="return doclink('link-6', 'Linear', 'link-4');">Linear</a></tt><tt class="py-op">,</tt> <tt class="py-param">bias</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Layer.__init__-expanded"><a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line"><tt class="py-docstring">        Initializes the layer.</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line"><tt class="py-docstring">        A layer is represented by a array where each line is the weight vector</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line"><tt class="py-docstring">        of a single neuron. The first element of the vector is the bias weight,</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line"><tt class="py-docstring">        in case the neuron is biased. Associated with the layer is an activation</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line"><tt class="py-docstring">        function defined in an appropriate way.</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line"><tt class="py-docstring">        :Parameters:</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line"><tt class="py-docstring">          shape</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line"><tt class="py-docstring">            Stablishes the size of the layer. It must be a two-tuple of the</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line"><tt class="py-docstring">            format ``(m, n)``, where ``m`` is the number of neurons in the</tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line"><tt class="py-docstring">            layer, and ``n`` is the number of inputs of each neuron. The neurons</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line"><tt class="py-docstring">            in the layer all have the same number of inputs.</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line"><tt class="py-docstring">          phi</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line"><tt class="py-docstring">            The activation function. It can be an ``Activation`` object (please,</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line"><tt class="py-docstring">            consult the ``af`` module) or a standard Python function. In this</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line"><tt class="py-docstring">            case, it must receive a single real value and return a single real</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line"><tt class="py-docstring">            value which determines if the neuron is activated or not. Defaults</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line"><tt class="py-docstring">            to ``Linear``.</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line"><tt class="py-docstring">          bias</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line"><tt class="py-docstring">            If ``True``, then the neurons on the layer are biased. That means</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line"><tt class="py-docstring">            that an additional weight is added to each neuron to represent the</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line"><tt class="py-docstring">            bias. If ``False``, no modification is made.</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">        <tt class="py-name">m</tt><tt class="py-op">,</tt> <tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt id="link-7" class="py-name" targets="Variable peach.nn.base.Layer.shape=peach.nn.base.Layer-class.html#shape"><a title="peach.nn.base.Layer.shape" class="py-name" href="#" onclick="return doclink('link-7', 'shape', 'link-7');">shape</a></tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-8" class="py-name" targets="Variable peach.nn.base.Layer.bias=peach.nn.base.Layer-class.html#bias,Variable peach.nn.nnet.FeedForward.bias=peach.nn.nnet.FeedForward-class.html#bias"><a title="peach.nn.base.Layer.bias
peach.nn.nnet.FeedForward.bias" class="py-name" href="#" onclick="return doclink('link-8', 'bias', 'link-8');">bias</a></tt><tt class="py-op">:</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">            <tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt class="py-name">n</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__weights</tt> <tt class="py-op">=</tt> <tt id="link-9" class="py-name"><a title="peach.nn.rbfn.randn" class="py-name" href="#" onclick="return doclink('link-9', 'randn', 'link-1');">randn</a></tt><tt class="py-op">(</tt><tt class="py-name">m</tt><tt class="py-op">,</tt> <tt class="py-name">n</tt><tt class="py-op">)</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__size</tt> <tt class="py-op">=</tt> <tt class="py-name">m</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__inputs</tt> <tt class="py-op">=</tt> <tt class="py-name">n</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line"> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line">        <tt class="py-comment"># The ``phi`` property sets the activation function, see below.</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name" targets="Variable peach.nn.base.Layer.phi=peach.nn.base.Layer-class.html#phi,Variable peach.nn.nnet.FeedForward.phi=peach.nn.nnet.FeedForward-class.html#phi,Variable peach.nn.rbfn.RBFN.phi=peach.nn.rbfn.RBFN-class.html#phi"><a title="peach.nn.base.Layer.phi
peach.nn.nnet.FeedForward.phi
peach.nn.rbfn.RBFN.phi" class="py-name" href="#" onclick="return doclink('link-10', 'phi', 'link-10');">phi</a></tt> <tt class="py-op">=</tt> <tt id="link-11" class="py-name"><a title="peach.nn.base.Layer.phi
peach.nn.nnet.FeedForward.phi
peach.nn.rbfn.RBFN.phi" class="py-name" href="#" onclick="return doclink('link-11', 'phi', 'link-10');">phi</a></tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line"> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">        <tt class="py-comment"># Properties.</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__v</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__y</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__bias</tt> <tt class="py-op">=</tt> <tt id="link-12" class="py-name"><a title="peach.nn.base.Layer.bias
peach.nn.nnet.FeedForward.bias" class="py-name" href="#" onclick="return doclink('link-12', 'bias', 'link-8');">bias</a></tt> </tt>
</div><a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line"> </tt>
<a name="Layer.__getsize"></a><div id="Layer.__getsize-def"><a name="L92"></a><tt class="py-lineno"> 92</tt> <a class="py-toggle" href="#" id="Layer.__getsize-toggle" onclick="return toggle('Layer.__getsize');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html#__getsize">__getsize</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer.__getsize-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Layer.__getsize-expanded"><a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__size</tt> </tt>
</div><a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">    <tt id="link-13" class="py-name" targets="Variable peach.ga.chromosome.Chromosome.size=peach.ga.chromosome.Chromosome-class.html#size,Variable peach.nn.base.Layer.size=peach.nn.base.Layer-class.html#size"><a title="peach.ga.chromosome.Chromosome.size
peach.nn.base.Layer.size" class="py-name" href="#" onclick="return doclink('link-13', 'size', 'link-13');">size</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-14" class="py-name" targets="Method peach.nn.base.Layer.__getsize()=peach.nn.base.Layer-class.html#__getsize"><a title="peach.nn.base.Layer.__getsize" class="py-name" href="#" onclick="return doclink('link-14', '__getsize', 'link-14');">__getsize</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">    <tt class="py-string">'''Number of neurons in the layer. Not writable.'''</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line"> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line"> </tt>
<a name="Layer.__getinputs"></a><div id="Layer.__getinputs-def"><a name="L98"></a><tt class="py-lineno"> 98</tt> <a class="py-toggle" href="#" id="Layer.__getinputs-toggle" onclick="return toggle('Layer.__getinputs');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html#__getinputs">__getinputs</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer.__getinputs-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Layer.__getinputs-expanded"><a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__bias</tt><tt class="py-op">:</tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__inputs</tt> <tt class="py-op">-</tt> <tt class="py-number">1</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__inputs</tt> </tt>
</div><a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">    <tt id="link-15" class="py-name" targets="Variable peach.nn.base.Layer.inputs=peach.nn.base.Layer-class.html#inputs,Variable peach.nn.mem.Hopfield.inputs=peach.nn.mem.Hopfield-class.html#inputs"><a title="peach.nn.base.Layer.inputs
peach.nn.mem.Hopfield.inputs" class="py-name" href="#" onclick="return doclink('link-15', 'inputs', 'link-15');">inputs</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-16" class="py-name" targets="Method peach.nn.base.Layer.__getinputs()=peach.nn.base.Layer-class.html#__getinputs,Method peach.nn.mem.Hopfield.__getinputs()=peach.nn.mem.Hopfield-class.html#__getinputs"><a title="peach.nn.base.Layer.__getinputs
peach.nn.mem.Hopfield.__getinputs" class="py-name" href="#" onclick="return doclink('link-16', '__getinputs', 'link-16');">__getinputs</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">    <tt class="py-string">'''Number of inputs for each neuron in the layer. Not writable.'''</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line"> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line"> </tt>
<a name="Layer.__getshape"></a><div id="Layer.__getshape-def"><a name="L107"></a><tt class="py-lineno">107</tt> <a class="py-toggle" href="#" id="Layer.__getshape-toggle" onclick="return toggle('Layer.__getshape');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html#__getshape">__getshape</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer.__getshape-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Layer.__getshape-expanded"><a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__bias</tt><tt class="py-op">:</tt> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__size</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__inputs</tt> <tt class="py-op">-</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__size</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__inputs</tt><tt class="py-op">)</tt> </tt>
</div><a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">    <tt id="link-17" class="py-name"><a title="peach.nn.base.Layer.shape" class="py-name" href="#" onclick="return doclink('link-17', 'shape', 'link-7');">shape</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-18" class="py-name" targets="Method peach.nn.base.Layer.__getshape()=peach.nn.base.Layer-class.html#__getshape"><a title="peach.nn.base.Layer.__getshape" class="py-name" href="#" onclick="return doclink('link-18', '__getshape', 'link-18');">__getshape</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line">    <tt class="py-string">'''Shape of the layer, given in the format of a tuple ``(m, n)``, where</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line"><tt class="py-string">    ``m`` is the number of neurons in the layer, and ``n`` is the number of</tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line"><tt class="py-string">    inputs in each neuron. Not writable.'''</tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line"> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line"> </tt>
<a name="Layer.__getbias"></a><div id="Layer.__getbias-def"><a name="L118"></a><tt class="py-lineno">118</tt> <a class="py-toggle" href="#" id="Layer.__getbias-toggle" onclick="return toggle('Layer.__getbias');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html#__getbias">__getbias</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer.__getbias-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Layer.__getbias-expanded"><a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__bias</tt> </tt>
</div><a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">    <tt id="link-19" class="py-name"><a title="peach.nn.base.Layer.bias
peach.nn.nnet.FeedForward.bias" class="py-name" href="#" onclick="return doclink('link-19', 'bias', 'link-8');">bias</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-20" class="py-name" targets="Method peach.nn.base.Layer.__getbias()=peach.nn.base.Layer-class.html#__getbias,Method peach.nn.nnet.FeedForward.__getbias()=peach.nn.nnet.FeedForward-class.html#__getbias"><a title="peach.nn.base.Layer.__getbias
peach.nn.nnet.FeedForward.__getbias" class="py-name" href="#" onclick="return doclink('link-20', '__getbias', 'link-20');">__getbias</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">    <tt class="py-string">'''True if the neuron is biased. Not writable.'''</tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line"> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line"> </tt>
<a name="Layer.__getweights"></a><div id="Layer.__getweights-def"><a name="L124"></a><tt class="py-lineno">124</tt> <a class="py-toggle" href="#" id="Layer.__getweights-toggle" onclick="return toggle('Layer.__getweights');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html#__getweights">__getweights</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer.__getweights-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Layer.__getweights-expanded"><a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__weights</tt> </tt>
</div><a name="Layer.__setweights"></a><div id="Layer.__setweights-def"><a name="L126"></a><tt class="py-lineno">126</tt> <a class="py-toggle" href="#" id="Layer.__setweights-toggle" onclick="return toggle('Layer.__setweights');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html#__setweights">__setweights</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">m</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer.__setweights-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Layer.__setweights-expanded"><a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__weights</tt> <tt class="py-op">=</tt> <tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">reshape</tt><tt class="py-op">(</tt><tt class="py-name">m</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name" targets="Variable peach.nn.base.Layer.weights=peach.nn.base.Layer-class.html#weights,Variable peach.nn.mem.Hopfield.weights=peach.nn.mem.Hopfield-class.html#weights,Variable peach.nn.rbfn.RBFN.weights=peach.nn.rbfn.RBFN-class.html#weights"><a title="peach.nn.base.Layer.weights
peach.nn.mem.Hopfield.weights
peach.nn.rbfn.RBFN.weights" class="py-name" href="#" onclick="return doclink('link-21', 'weights', 'link-21');">weights</a></tt><tt class="py-op">.</tt><tt id="link-22" class="py-name"><a title="peach.nn.base.Layer.shape" class="py-name" href="#" onclick="return doclink('link-22', 'shape', 'link-7');">shape</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">    <tt id="link-23" class="py-name"><a title="peach.nn.base.Layer.weights
peach.nn.mem.Hopfield.weights
peach.nn.rbfn.RBFN.weights" class="py-name" href="#" onclick="return doclink('link-23', 'weights', 'link-21');">weights</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-24" class="py-name" targets="Method peach.nn.base.Layer.__getweights()=peach.nn.base.Layer-class.html#__getweights,Method peach.nn.mem.Hopfield.__getweights()=peach.nn.mem.Hopfield-class.html#__getweights,Method peach.nn.rbfn.RBFN.__getweights()=peach.nn.rbfn.RBFN-class.html#__getweights"><a title="peach.nn.base.Layer.__getweights
peach.nn.mem.Hopfield.__getweights
peach.nn.rbfn.RBFN.__getweights" class="py-name" href="#" onclick="return doclink('link-24', '__getweights', 'link-24');">__getweights</a></tt><tt class="py-op">,</tt> <tt id="link-25" class="py-name" targets="Method peach.nn.base.Layer.__setweights()=peach.nn.base.Layer-class.html#__setweights,Method peach.nn.mem.Hopfield.__setweights()=peach.nn.mem.Hopfield-class.html#__setweights,Method peach.nn.rbfn.RBFN.__setweights()=peach.nn.rbfn.RBFN-class.html#__setweights"><a title="peach.nn.base.Layer.__setweights
peach.nn.mem.Hopfield.__setweights
peach.nn.rbfn.RBFN.__setweights" class="py-name" href="#" onclick="return doclink('link-25', '__setweights', 'link-25');">__setweights</a></tt><tt class="py-op">)</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">    <tt class="py-string">'''A ``numpy`` array containing the synaptic weights of the network. Each</tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line"><tt class="py-string">    line is the weight vector of a neuron. It is writable, but the new weight</tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"><tt class="py-string">    array must be the same shape of the neuron, or an exception is raised.'''</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line"> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line"> </tt>
<a name="Layer.__getphi"></a><div id="Layer.__getphi-def"><a name="L134"></a><tt class="py-lineno">134</tt> <a class="py-toggle" href="#" id="Layer.__getphi-toggle" onclick="return toggle('Layer.__getphi');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html#__getphi">__getphi</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer.__getphi-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Layer.__getphi-expanded"><a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__phi</tt> </tt>
</div><a name="Layer.__setphi"></a><div id="Layer.__setphi-def"><a name="L136"></a><tt class="py-lineno">136</tt> <a class="py-toggle" href="#" id="Layer.__setphi-toggle" onclick="return toggle('Layer.__setphi');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html#__setphi">__setphi</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">phi</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer.__setphi-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Layer.__setphi-expanded"><a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">            <tt class="py-name">issubclass</tt><tt class="py-op">(</tt><tt id="link-26" class="py-name"><a title="peach.nn.base.Layer.phi
peach.nn.nnet.FeedForward.phi
peach.nn.rbfn.RBFN.phi" class="py-name" href="#" onclick="return doclink('link-26', 'phi', 'link-10');">phi</a></tt><tt class="py-op">,</tt> <tt id="link-27" class="py-name"><a title="peach.nn.af.Activation" class="py-name" href="#" onclick="return doclink('link-27', 'Activation', 'link-3');">Activation</a></tt><tt class="py-op">)</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line">            <tt id="link-28" class="py-name"><a title="peach.nn.base.Layer.phi
peach.nn.nnet.FeedForward.phi
peach.nn.rbfn.RBFN.phi" class="py-name" href="#" onclick="return doclink('link-28', 'phi', 'link-10');">phi</a></tt> <tt class="py-op">=</tt> <tt id="link-29" class="py-name"><a title="peach.nn.base.Layer.phi
peach.nn.nnet.FeedForward.phi
peach.nn.rbfn.RBFN.phi" class="py-name" href="#" onclick="return doclink('link-29', 'phi', 'link-10');">phi</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">TypeError</tt><tt class="py-op">:</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">            <tt class="py-keyword">pass</tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt id="link-30" class="py-name"><a title="peach.nn.base.Layer.phi
peach.nn.nnet.FeedForward.phi
peach.nn.rbfn.RBFN.phi" class="py-name" href="#" onclick="return doclink('link-30', 'phi', 'link-10');">phi</a></tt><tt class="py-op">,</tt> <tt id="link-31" class="py-name"><a title="peach.nn.af.Activation" class="py-name" href="#" onclick="return doclink('link-31', 'Activation', 'link-3');">Activation</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__phi</tt> <tt class="py-op">=</tt> <tt id="link-32" class="py-name"><a title="peach.nn.base.Layer.phi
peach.nn.nnet.FeedForward.phi
peach.nn.rbfn.RBFN.phi" class="py-name" href="#" onclick="return doclink('link-32', 'phi', 'link-10');">phi</a></tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__phi</tt> <tt class="py-op">=</tt> <tt id="link-33" class="py-name"><a title="peach.nn.af.Activation" class="py-name" href="#" onclick="return doclink('link-33', 'Activation', 'link-3');">Activation</a></tt><tt class="py-op">(</tt><tt id="link-34" class="py-name"><a title="peach.nn.base.Layer.phi
peach.nn.nnet.FeedForward.phi
peach.nn.rbfn.RBFN.phi" class="py-name" href="#" onclick="return doclink('link-34', 'phi', 'link-10');">phi</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line">    <tt id="link-35" class="py-name"><a title="peach.nn.base.Layer.phi
peach.nn.nnet.FeedForward.phi
peach.nn.rbfn.RBFN.phi" class="py-name" href="#" onclick="return doclink('link-35', 'phi', 'link-10');">phi</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-36" class="py-name" targets="Method peach.nn.base.Layer.__getphi()=peach.nn.base.Layer-class.html#__getphi,Method peach.nn.nnet.FeedForward.__getphi()=peach.nn.nnet.FeedForward-class.html#__getphi,Method peach.nn.rbfn.RBFN.__getphi()=peach.nn.rbfn.RBFN-class.html#__getphi"><a title="peach.nn.base.Layer.__getphi
peach.nn.nnet.FeedForward.__getphi
peach.nn.rbfn.RBFN.__getphi" class="py-name" href="#" onclick="return doclink('link-36', '__getphi', 'link-36');">__getphi</a></tt><tt class="py-op">,</tt> <tt id="link-37" class="py-name" targets="Method peach.nn.base.Layer.__setphi()=peach.nn.base.Layer-class.html#__setphi,Method peach.nn.nnet.FeedForward.__setphi()=peach.nn.nnet.FeedForward-class.html#__setphi,Method peach.nn.rbfn.RBFN.__setphi()=peach.nn.rbfn.RBFN-class.html#__setphi"><a title="peach.nn.base.Layer.__setphi
peach.nn.nnet.FeedForward.__setphi
peach.nn.rbfn.RBFN.__setphi" class="py-name" href="#" onclick="return doclink('link-37', '__setphi', 'link-37');">__setphi</a></tt><tt class="py-op">)</tt> </tt>
<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">    <tt class="py-string">'''The activation function. It can be set with an ``Activation`` instance or</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line"><tt class="py-string">    a standard Python function. If a standard function is given, it must receive</tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line"><tt class="py-string">    a real value and return a real value that is the activation value of the</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line"><tt class="py-string">    neuron. In that case, it is adjusted to work accordingly with the internals</tt> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line"><tt class="py-string">    of the layer.'''</tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line"> </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line"> </tt>
<a name="Layer.__getv"></a><div id="Layer.__getv-def"><a name="L154"></a><tt class="py-lineno">154</tt> <a class="py-toggle" href="#" id="Layer.__getv-toggle" onclick="return toggle('Layer.__getv');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html#__getv">__getv</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer.__getv-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Layer.__getv-expanded"><a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__v</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">,</tt> <tt class="py-string">'activation potential unavailable'</tt> </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__v</tt> </tt>
</div><a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line">    <tt id="link-38" class="py-name" targets="Variable peach.nn.base.Layer.v=peach.nn.base.Layer-class.html#v"><a title="peach.nn.base.Layer.v" class="py-name" href="#" onclick="return doclink('link-38', 'v', 'link-38');">v</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-39" class="py-name" targets="Method peach.nn.base.Layer.__getv()=peach.nn.base.Layer-class.html#__getv"><a title="peach.nn.base.Layer.__getv" class="py-name" href="#" onclick="return doclink('link-39', '__getv', 'link-39');">__getv</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line">    <tt class="py-string">'''The activation potential of the neuron. Not writable, and only available</tt> </tt>
<a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line"><tt class="py-string">    after the neuron is fed some input.'''</tt> </tt>
<a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line"> </tt>
<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line"> </tt>
<a name="Layer.__gety"></a><div id="Layer.__gety-def"><a name="L164"></a><tt class="py-lineno">164</tt> <a class="py-toggle" href="#" id="Layer.__gety-toggle" onclick="return toggle('Layer.__gety');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html#__gety">__gety</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer.__gety-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Layer.__gety-expanded"><a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__y</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">,</tt> <tt class="py-string">'activation unavailable'</tt> </tt>
<a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__y</tt> </tt>
</div><a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">    <tt id="link-40" class="py-name" targets="Variable peach.fuzzy.control.Controller.y=peach.fuzzy.control.Controller-class.html#y,Variable peach.nn.base.Layer.y=peach.nn.base.Layer-class.html#y,Variable peach.nn.nnet.FeedForward.y=peach.nn.nnet.FeedForward-class.html#y,Variable peach.nn.nnet.SOM.y=peach.nn.nnet.SOM-class.html#y,Variable peach.nn.rbfn.RBFN.y=peach.nn.rbfn.RBFN-class.html#y"><a title="peach.fuzzy.control.Controller.y
peach.nn.base.Layer.y
peach.nn.nnet.FeedForward.y
peach.nn.nnet.SOM.y
peach.nn.rbfn.RBFN.y" class="py-name" href="#" onclick="return doclink('link-40', 'y', 'link-40');">y</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-41" class="py-name" targets="Method peach.fuzzy.control.Controller.__gety()=peach.fuzzy.control.Controller-class.html#__gety,Method peach.nn.base.Layer.__gety()=peach.nn.base.Layer-class.html#__gety,Method peach.nn.nnet.FeedForward.__gety()=peach.nn.nnet.FeedForward-class.html#__gety,Method peach.nn.nnet.SOM.__gety()=peach.nn.nnet.SOM-class.html#__gety,Method peach.nn.rbfn.RBFN.__gety()=peach.nn.rbfn.RBFN-class.html#__gety"><a title="peach.fuzzy.control.Controller.__gety
peach.nn.base.Layer.__gety
peach.nn.nnet.FeedForward.__gety
peach.nn.nnet.SOM.__gety
peach.nn.rbfn.RBFN.__gety" class="py-name" href="#" onclick="return doclink('link-41', '__gety', 'link-41');">__gety</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line">    <tt class="py-string">'''The activation value of the neuron. Not writable, and only available</tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line"><tt class="py-string">    after the neuron is fed some input.'''</tt> </tt>
<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line"> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line"> </tt>
<a name="Layer.__getitem__"></a><div id="Layer.__getitem__-def"><a name="L174"></a><tt class="py-lineno">174</tt> <a class="py-toggle" href="#" id="Layer.__getitem__-toggle" onclick="return toggle('Layer.__getitem__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html#__getitem__">__getitem__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">n</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer.__getitem__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Layer.__getitem__-expanded"><a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line"><tt class="py-docstring">        The ``[ ]`` get interface.</tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line"><tt class="py-docstring">        The input to this method is forwarded to the ``weights`` property. That</tt> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line"><tt class="py-docstring">        means that it will return the respective line/element of the weight</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line"><tt class="py-docstring">        array.</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line"><tt class="py-docstring">        :Parameters:</tt> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line"><tt class="py-docstring">          n</tt> </tt>
<a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line"><tt class="py-docstring">            A slice object containing the elements referenced. Since it is</tt> </tt>
<a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line"><tt class="py-docstring">            forwarded to an array, it behaves exactly as one.</tt> </tt>
<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line"><tt class="py-docstring">        :Returns:</tt> </tt>
<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line"><tt class="py-docstring">          The element or elements in the referenced indices.</tt> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-42" class="py-name"><a title="peach.nn.base.Layer.weights
peach.nn.mem.Hopfield.weights
peach.nn.rbfn.RBFN.weights" class="py-name" href="#" onclick="return doclink('link-42', 'weights', 'link-21');">weights</a></tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
</div><a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line"> </tt>
<a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line"> </tt>
<a name="Layer.__setitem__"></a><div id="Layer.__setitem__-def"><a name="L193"></a><tt class="py-lineno">193</tt> <a class="py-toggle" href="#" id="Layer.__setitem__-toggle" onclick="return toggle('Layer.__setitem__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html#__setitem__">__setitem__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">n</tt><tt class="py-op">,</tt> <tt class="py-param">w</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer.__setitem__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Layer.__setitem__-expanded"><a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line"><tt class="py-docstring">        The ``[ ]`` set interface.</tt> </tt>
<a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line"><tt class="py-docstring">        The inputs to this method are forwarded to the ``weights`` property.</tt> </tt>
<a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line"><tt class="py-docstring">        That means that it will set the respective line/element of the weight</tt> </tt>
<a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line"><tt class="py-docstring">        array.</tt> </tt>
<a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line"><tt class="py-docstring">        :Parameters:</tt> </tt>
<a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line"><tt class="py-docstring">          n</tt> </tt>
<a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line"><tt class="py-docstring">            A slice object containing the elements referenced. Since it is</tt> </tt>
<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line"><tt class="py-docstring">            forwarded to an array, it behaves exactly as one.</tt> </tt>
<a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L206"></a><tt class="py-lineno">206</tt>  <tt class="py-line"><tt class="py-docstring">          w</tt> </tt>
<a name="L207"></a><tt class="py-lineno">207</tt>  <tt class="py-line"><tt class="py-docstring">            A value or array of values to be set in the given indices.</tt> </tt>
<a name="L208"></a><tt class="py-lineno">208</tt>  <tt class="py-line"><tt class="py-docstring">       '''</tt> </tt>
<a name="L209"></a><tt class="py-lineno">209</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-43" class="py-name"><a title="peach.nn.base.Layer.weights
peach.nn.mem.Hopfield.weights
peach.nn.rbfn.RBFN.weights" class="py-name" href="#" onclick="return doclink('link-43', 'weights', 'link-21');">weights</a></tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">w</tt> </tt>
</div><a name="L210"></a><tt class="py-lineno">210</tt>  <tt class="py-line"> </tt>
<a name="L211"></a><tt class="py-lineno">211</tt>  <tt class="py-line"> </tt>
<a name="Layer.__call__"></a><div id="Layer.__call__-def"><a name="L212"></a><tt class="py-lineno">212</tt> <a class="py-toggle" href="#" id="Layer.__call__-toggle" onclick="return toggle('Layer.__call__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="peach.nn.base.Layer-class.html#__call__">__call__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">x</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Layer.__call__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Layer.__call__-expanded"><a name="L213"></a><tt class="py-lineno">213</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L214"></a><tt class="py-lineno">214</tt>  <tt class="py-line"><tt class="py-docstring">        The feedforward method to the layer.</tt> </tt>
<a name="L215"></a><tt class="py-lineno">215</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L216"></a><tt class="py-lineno">216</tt>  <tt class="py-line"><tt class="py-docstring">        The ``__call__`` interface should be called if the answer of the neuron</tt> </tt>
<a name="L217"></a><tt class="py-lineno">217</tt>  <tt class="py-line"><tt class="py-docstring">        to a given input vector ``x`` is desired. *This method has collateral</tt> </tt>
<a name="L218"></a><tt class="py-lineno">218</tt>  <tt class="py-line"><tt class="py-docstring">        effects*, so beware. After the calling of this method, the ``v`` and</tt> </tt>
<a name="L219"></a><tt class="py-lineno">219</tt>  <tt class="py-line"><tt class="py-docstring">        ``y`` properties are set with the activation potential and the answer of</tt> </tt>
<a name="L220"></a><tt class="py-lineno">220</tt>  <tt class="py-line"><tt class="py-docstring">        the neurons, respectivelly.</tt> </tt>
<a name="L221"></a><tt class="py-lineno">221</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L222"></a><tt class="py-lineno">222</tt>  <tt class="py-line"><tt class="py-docstring">        :Parameters:</tt> </tt>
<a name="L223"></a><tt class="py-lineno">223</tt>  <tt class="py-line"><tt class="py-docstring">          x</tt> </tt>
<a name="L224"></a><tt class="py-lineno">224</tt>  <tt class="py-line"><tt class="py-docstring">            The input vector to the layer.</tt> </tt>
<a name="L225"></a><tt class="py-lineno">225</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L226"></a><tt class="py-lineno">226</tt>  <tt class="py-line"><tt class="py-docstring">        :Returns:</tt> </tt>
<a name="L227"></a><tt class="py-lineno">227</tt>  <tt class="py-line"><tt class="py-docstring">          The vector containing the answer of every neuron in the layer, in the</tt> </tt>
<a name="L228"></a><tt class="py-lineno">228</tt>  <tt class="py-line"><tt class="py-docstring">          respective order.</tt> </tt>
<a name="L229"></a><tt class="py-lineno">229</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L230"></a><tt class="py-lineno">230</tt>  <tt class="py-line">        <tt class="py-comment"># Adjusts the input vector in case the neuron is biased. Also, the</tt> </tt>
<a name="L231"></a><tt class="py-lineno">231</tt>  <tt class="py-line">        <tt class="py-comment"># input vector is reshaped as a column-vector.</tt> </tt>
<a name="L232"></a><tt class="py-lineno">232</tt>  <tt class="py-line">        <tt id="link-44" class="py-name" targets="Variable peach.fuzzy.cmeans.FuzzyCMeans.x=peach.fuzzy.cmeans.FuzzyCMeans-class.html#x,Variable peach.optm.linear.Direct1D.x=peach.optm.linear.Direct1D-class.html#x,Variable peach.optm.linear.GoldenRule.x=peach.optm.linear.GoldenRule-class.html#x,Variable peach.optm.linear.Interpolation.x=peach.optm.linear.Interpolation-class.html#x,Variable peach.optm.multivar.Direct.x=peach.optm.multivar.Direct-class.html#x,Variable peach.optm.multivar.Gradient.x=peach.optm.multivar.Gradient-class.html#x,Variable peach.optm.multivar.MomentumGradient.x=peach.optm.multivar.MomentumGradient-class.html#x,Variable peach.optm.multivar.Newton.x=peach.optm.multivar.Newton-class.html#x,Variable peach.optm.quasinewton.DFP.x=peach.optm.quasinewton.DFP-class.html#x,Variable peach.optm.quasinewton.SR1.x=peach.optm.quasinewton.SR1-class.html#x,Variable peach.sa.base.BinarySA.x=peach.sa.base.BinarySA-class.html#x,Variable peach.sa.base.ContinuousSA.x=peach.sa.base.ContinuousSA-class.html#x"><a title="peach.fuzzy.cmeans.FuzzyCMeans.x
peach.optm.linear.Direct1D.x
peach.optm.linear.GoldenRule.x
peach.optm.linear.Interpolation.x
peach.optm.multivar.Direct.x
peach.optm.multivar.Gradient.x
peach.optm.multivar.MomentumGradient.x
peach.optm.multivar.Newton.x
peach.optm.quasinewton.DFP.x
peach.optm.quasinewton.SR1.x
peach.sa.base.BinarySA.x
peach.sa.base.ContinuousSA.x" class="py-name" href="#" onclick="return doclink('link-44', 'x', 'link-44');">x</a></tt> <tt class="py-op">=</tt> <tt class="py-name">reshape</tt><tt class="py-op">(</tt><tt id="link-45" class="py-name"><a title="peach.fuzzy.cmeans.FuzzyCMeans.x
peach.optm.linear.Direct1D.x
peach.optm.linear.GoldenRule.x
peach.optm.linear.Interpolation.x
peach.optm.multivar.Direct.x
peach.optm.multivar.Gradient.x
peach.optm.multivar.MomentumGradient.x
peach.optm.multivar.Newton.x
peach.optm.quasinewton.DFP.x
peach.optm.quasinewton.SR1.x
peach.sa.base.BinarySA.x
peach.sa.base.ContinuousSA.x" class="py-name" href="#" onclick="return doclink('link-45', 'x', 'link-44');">x</a></tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-46" class="py-name"><a title="peach.nn.base.Layer.inputs
peach.nn.mem.Hopfield.inputs" class="py-name" href="#" onclick="return doclink('link-46', 'inputs', 'link-15');">inputs</a></tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L233"></a><tt class="py-lineno">233</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__bias</tt><tt class="py-op">:</tt> </tt>
<a name="L234"></a><tt class="py-lineno">234</tt>  <tt class="py-line">            <tt id="link-47" class="py-name"><a title="peach.fuzzy.cmeans.FuzzyCMeans.x
peach.optm.linear.Direct1D.x
peach.optm.linear.GoldenRule.x
peach.optm.linear.Interpolation.x
peach.optm.multivar.Direct.x
peach.optm.multivar.Gradient.x
peach.optm.multivar.MomentumGradient.x
peach.optm.multivar.Newton.x
peach.optm.quasinewton.DFP.x
peach.optm.quasinewton.SR1.x
peach.sa.base.BinarySA.x
peach.sa.base.ContinuousSA.x" class="py-name" href="#" onclick="return doclink('link-47', 'x', 'link-44');">x</a></tt> <tt class="py-op">=</tt> <tt class="py-name">vstack</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt id="link-48" class="py-name"><a title="peach.nn.base._BIAS
peach.nn.lrules._BIAS" class="py-name" href="#" onclick="return doclink('link-48', '_BIAS', 'link-5');">_BIAS</a></tt><tt class="py-op">,</tt> <tt id="link-49" class="py-name"><a title="peach.fuzzy.cmeans.FuzzyCMeans.x
peach.optm.linear.Direct1D.x
peach.optm.linear.GoldenRule.x
peach.optm.linear.Interpolation.x
peach.optm.multivar.Direct.x
peach.optm.multivar.Gradient.x
peach.optm.multivar.MomentumGradient.x
peach.optm.multivar.Newton.x
peach.optm.quasinewton.DFP.x
peach.optm.quasinewton.SR1.x
peach.sa.base.BinarySA.x
peach.sa.base.ContinuousSA.x" class="py-name" href="#" onclick="return doclink('link-49', 'x', 'link-44');">x</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L235"></a><tt class="py-lineno">235</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__v</tt> <tt class="py-op">=</tt> <tt class="py-name">dot</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-50" class="py-name"><a title="peach.nn.base.Layer.weights
peach.nn.mem.Hopfield.weights
peach.nn.rbfn.RBFN.weights" class="py-name" href="#" onclick="return doclink('link-50', 'weights', 'link-21');">weights</a></tt><tt class="py-op">,</tt> <tt id="link-51" class="py-name"><a title="peach.fuzzy.cmeans.FuzzyCMeans.x
peach.optm.linear.Direct1D.x
peach.optm.linear.GoldenRule.x
peach.optm.linear.Interpolation.x
peach.optm.multivar.Direct.x
peach.optm.multivar.Gradient.x
peach.optm.multivar.MomentumGradient.x
peach.optm.multivar.Newton.x
peach.optm.quasinewton.DFP.x
peach.optm.quasinewton.SR1.x
peach.sa.base.BinarySA.x
peach.sa.base.ContinuousSA.x" class="py-name" href="#" onclick="return doclink('link-51', 'x', 'link-44');">x</a></tt><tt class="py-op">)</tt> </tt>
<a name="L236"></a><tt class="py-lineno">236</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__y</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-52" class="py-name"><a title="peach.nn.base.Layer.phi
peach.nn.nnet.FeedForward.phi
peach.nn.rbfn.RBFN.phi" class="py-name" href="#" onclick="return doclink('link-52', 'phi', 'link-10');">phi</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__v</tt><tt class="py-op">)</tt> </tt>
<a name="L237"></a><tt class="py-lineno">237</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__y</tt> </tt>
</div></div><a name="L238"></a><tt class="py-lineno">238</tt>  <tt class="py-line"> </tt>
<a name="L239"></a><tt class="py-lineno">239</tt>  <tt class="py-line"> </tt>
<a name="L240"></a><tt class="py-lineno">240</tt>  <tt class="py-line"><tt class="py-comment">################################################################################</tt> </tt>
<a name="L241"></a><tt class="py-lineno">241</tt>  <tt class="py-line"><tt class="py-comment"># Test</tt> </tt>
<a name="L242"></a><tt class="py-lineno">242</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">"__main__"</tt><tt class="py-op">:</tt> </tt>
<a name="L243"></a><tt class="py-lineno">243</tt>  <tt class="py-line">    <tt class="py-keyword">pass</tt> </tt>
<a name="L244"></a><tt class="py-lineno">244</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="peach-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a href="http://code.google.com/p/peach">Peach - Computational Intelligence for Python</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sun Jul 31 16:59:52 2011
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
